function [ A, Hed] = calcMatchedFilter(nt, fs, nx, dx, d, fc, BW)
%UNTITLED2 Summary of this function goes here
%   Detailed explanation goes here
wc = 2*pi*fc;
BWw = 2*pi*BW;
w = (-nt/2:nt/2-1)*2*pi*fs/nt;
kx = (-nx/2:nx/2-1)/dx/nx;
A = jinc(kx*d/2).^2;
Hed = (w.*cossquare(w, wc, BWw)).^2;
Hed = Hed ./ max(Hed);
end

